﻿Module validaciones
    Public Sub validarInt(ByVal e As System.Windows.Forms.KeyPressEventArgs)
        If (Not Char.IsNumber(e.KeyChar) And e.KeyChar <> Microsoft.VisualBasic.ChrW(8)) Then
            e.Handled = True
        End If
    End Sub

    Public Sub validarDouble(ByVal e As System.Windows.Forms.KeyPressEventArgs)
        If (Not Char.IsNumber(e.KeyChar) And e.KeyChar <> Microsoft.VisualBasic.ChrW(8) And e.KeyChar <> Microsoft.VisualBasic.ChrW(44)) Then
            e.Handled = True
        End If
    End Sub

    Public Sub validarString(ByVal e As System.Windows.Forms.KeyPressEventArgs)
        If (Not Char.IsLetter(e.KeyChar) And e.KeyChar <> Microsoft.VisualBasic.ChrW(8) And e.KeyChar <> Microsoft.VisualBasic.ChrW(32)) Then
            e.Handled = True
        End If
    End Sub

    Public Sub validarTelefono(ByVal e As System.Windows.Forms.KeyPressEventArgs)
        If (Not Char.IsNumber(e.KeyChar) And e.KeyChar <> Microsoft.VisualBasic.ChrW(8) And e.KeyChar <> Microsoft.VisualBasic.ChrW(45)) Then
            e.Handled = True
        End If
    End Sub
    Public Function ValidaFecha(ByVal FecDesde As Date, ByVal FecHasta As Date) As Boolean
        If FecDesde > FecHasta Then
            MessageBox.Show("Fecha Desde no puede ser Mayor que Fecha Hasta.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return False
        Else
            Return True
        End If
    End Function
End Module
